﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HuynhQuangWebsite.Models.HomeAdminListViewModel>" %>
<%@ Import Namespace="THS.HtmlHelpers" %>

  <div class="widget">
        <div class="title"><img src="../../Images/adminSite/icons/dark/Admins.png" alt="" class="titleIcon" /><h6>Danh sách thành viên</h6></div>
        <ul class="partners">
        <%if (Model != null)
          {
              if (Model.UserList != null)
              {
                  foreach (var item in Model.UserList)
                  {
                  %>
            <li>
                
                <div class="pInfo">
                    <a href="<%=Url.Action("Detail","ManageUser",new {id=item.UserID})%>"><strong><%=item.UserName%></strong></a>
                    <i> <%=item.Email %></i>
                      <i><%=Html.CheckBox("UserIsActive", item.UserIsActive, new {@class="activeID", onclick = "ActiveUser('" + item.UserID + "')" })%></i><label for="check1">Cho phép đăng nhập</label>
                      	
                </div>
                <div class="pLinks">
                    <a href="#" title="Direct call" class="tipW"><img src="../../Images/adminSite/icons/pSkype.png" alt="" /></a>
                    <a href="#" title="Send an email" class="tipW"><img src="../../Images/adminSite/icons/pEmail.png" alt="" /></a>
                </div>
                <div class="clear"></div>
            </li>
           <%} %>
                
        </ul>
         <div class="divider_line"></div>
					        <div class="pagination wp-pagenavi">
						       
                                    <%=Ajax.Pager(Model.UserInfo.CurrentPage, Model.UserInfo.TotalItems, "UserList", 0, Model.UserInfo.ItemsPerPage, "Paging")%>
					        </div>	
                            <%}
          } %>
             <script type="text/javascript">
                 function ConfirmActive() {
                     if (confirm("Bạn chắc chắn hiển thị toàn bộ danh sách?")===true) {
                         return true;
                     }
                     else {
                         return false;
                     }

                 }
                 function ConfirmDeActive() {
                     if (confirm("Bạn chắc chắn ẩn toàn bộ danh sách?")===true) {
                         return true;
                     }
                     else {
                         return false;
                     }

                 }
                 function ConfirmDelete() {
                     if (confirm("Bạn chắc chắn xóa?")===true) {
                         return true;
                     }
                     else {
                         return false;
                     }

                 }

                 function ActiveUser(id) {
                     var v = $('#UserIsActive').val();

                     $.post("/ManageUser/ActiveUser", { id: id });


                 }
             </script>
      
			     
			    
    </script>
    </div>